package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * StoreSupplier entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_STORE_SUPPLIER", schema = "HCD_DEV")
public class StoreSupplier extends Entity implements java.io.Serializable {

	// Fields

	private Long supplierId;
	private Store store;
	private String name;
	private String contacts;
	private String phone;

	// Constructors

	/** default constructor */
	public StoreSupplier() {
	}

	/** minimal constructor */
	public StoreSupplier(Store store, String name) {
		this.store = store;
		this.name = name;
	}

	/** full constructor */
	public StoreSupplier(Store store, String name, String contacts, String phone) {
		this.store = store;
		this.name = name;
		this.contacts = contacts;
		this.phone = phone;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_STORE_SUPPLIER")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "SUPPLIER_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getSupplierId() {
		return this.supplierId;
	}

	public void setSupplierId(Long supplierId) {
		this.supplierId = supplierId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_ID", nullable = false)
	public Store getStore() {
		return this.store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	@Column(name = "NAME", nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "CONTACTS", length = 60)
	public String getContacts() {
		return this.contacts;
	}

	public void setContacts(String contacts) {
		this.contacts = contacts;
	}

	@Column(name = "PHONE", length = 20)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

}